import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios';
import VCharts from 'v-charts'
axios.defaults.baseURL='http://localhost:8888/vallis'
axios.interceptors.request.use(config=>{
  // console.log(config)

  if(window.sessionStorage.getItem('token')===''||window.sessionStorage.getItem('token')===null){
   config.headers.Authorization='vallis'
  }else{
    config.headers.Authorization=window.sessionStorage.getItem('token')
  }
   return config
 })
 
 Vue.prototype.$http=axios;
Vue.config.productionTip = false
Vue.use(VCharts)
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
